import React from 'react';
import { Empty as AntdEmpty } from 'antd';
import type { EmptyProps as AntdEmptyProps } from 'antd';
import { createStyles } from 'antd-style';

export interface EmptyProps extends AntdEmptyProps {
  /**
   * @description 自定义样式类名
   */
  customClassName?: string;
}

const useStyles = createStyles(({ token, css }) => ({
  empty: css`
    color: ${token.colorTextSecondary};
  `,
}));

const EmptyComponent: React.FC<EmptyProps> = ({ customClassName, className, ...restProps }) => {
  const { styles, cx } = useStyles();
  
  const emptyClassName = cx(
    className,
    customClassName,
    styles.empty
  );

  return <AntdEmpty className={emptyClassName} {...restProps} />;
};

const Empty = Object.assign(EmptyComponent, {
  PRESENTED_IMAGE_SIMPLE: AntdEmpty.PRESENTED_IMAGE_SIMPLE,
  PRESENTED_IMAGE_DEFAULT: AntdEmpty.PRESENTED_IMAGE_DEFAULT,
});

export { Empty };
export default Empty;

